package ee.reino.soundFiles;

import java.io.FileInputStream;
import java.io.InputStream;
import sun.audio.*;

import javax.sound.sampled.AudioSystem;

public class SoundPlayer2 {
	public synchronized void playSound(String audioFileName) {
		try {
			InputStream inputStream = new FileInputStream(audioFileName);
			AudioStream audioStream = new AudioStream(inputStream);
			AudioPlayer.player.start(audioStream);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
